<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Edit Information</title>
	
<style>
body,textarea{
	font-family: meiryo;
	font-size: 12px;
}

</style>

</head>


<body>
	<h1><?php echo $company->kaisha_mei?> <font color="green">編集</font></h1>
</body>

<a href="/admin">admin</a>&nbsp;
<form action="/admin/update/<?php echo $company->id?>" method="post">

<table>
<?php foreach ($company as $key => $value) if ( $key === "type" ){?>
	
	<tr>
		<th><?php echo $key?></th>
		<td>
			<?php foreach ($intern_type as $key => $value) {
				echo $value.form_checkbox('type[]', $key, !(strpos($company->type, $key."")===false))."&nbsp;&nbsp;";
			}?>
		</td>
	</tr>

<?php }else if ( $key === "what_id" ){?>
	
	<tr>
		<th><?php echo $key?></th>
		<td>
			<?php foreach ($what_name as $key => $value) {
				echo $value.form_checkbox('what_id[]', $key, !(strpos($company->what_id, $key."")===false))."&nbsp;&nbsp;";
			}?>
			
		</td>
	</tr>
	
<?php }else if ( $key === "area_id" ){?>

	<tr>
		<th><?php echo $key?></th>
		<td>
			<?php foreach ($area_name as $key => $value) {
				echo $value.form_checkbox('area_id[]', $key, !(strpos($company->area_id, $key."")===false))."&nbsp;&nbsp;";
			}?>
		</td>
	</tr>

<?php }else if ( $key != "id" && $key != "delete_tag" ){?>
	
	<tr>
		<th><?php echo $key?></th>
		
		<?php if ($type[$key] === "string" || $type[$key] === "int" ){?>
			
		  <td><input type="text" size="40" name="<?php echo $key?>" value="<?php echo $value?>" /></td>
		  
		<?php }else{?>
			
		  <td><textarea cols="60" rows="7" name="<?php echo $key?>"><?php echo $value?></textarea></td>
		  	
		<?php }?>
		
	</tr>
	
<?php }?>

</table>

<input type="submit" value="Preview" />&nbsp;
<input type="reset" value="Reset" />

<h2>Meta Info</h2>
<table>
<?php foreach ($company_meta as $key => $value) if ($key!="id" && $key!="company_id"){?>
	<tr>
		<th><?php echo $key?></th>
		
		<?php if ($type[$key] === "string" || $type[$key] === "int" ){?>
			
		  <td><input type="text" size="40" name="<?php echo $key?>" value="<?php echo $value?>" /></td>
		  
		<?php }else{?>
			
		  <td><textarea cols="60" rows="7" name="<?php echo $key?>"><?php echo $value?></textarea></td>
		  	
		<?php }?>
		
	</tr>
<?php }?>
</table>

<input type="submit" value="Preview" />&nbsp;
<input type="reset" value="Reset" />

</form>

</html>
